package com.xxin.core.exception;

import com.xxin.core.resp.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author lvjx
 * @description 全局异常处理器
 * @date 2024/9/6 14:51
 */
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler{
	
	
	/**
	 * 处理所有异常信息
	 */
	@ExceptionHandler(Exception.class)
	public Result handleException(Exception e){
		return Result.error(e.getMessage());
	}
}
